﻿<controls:ChildWindow x:Class="FIFP.DashBoard.Views.ReducedCapacityPopup"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
           xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"        
           xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
           Width="450" Height="180" 
           xmlns:Presentation="clr-namespace:FIFP.Common.Behaviors.CommonEventArgs;assembly=FIFP.Common"
           DataContext="{Binding ShutdownMngVM, Source={StaticResource ServiceLocator}}"
           Title="Reduced Capacity" Style="{StaticResource CreateTicket}" OverlayBrush="#7F000000">
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Button x:Name="CloseButton" Grid.Column="1" HorizontalAlignment="Right" Height="14" IsTabStop="False" Style="{StaticResource CloseButtonStyle}" VerticalAlignment="Top" Width="15" Cursor="Hand" Margin="0,0,-2,0">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="Click">
                    <i:InvokeCommandAction
                                                    Command="{Binding CancelCommand}"
                                                    CommandParameter="{Binding ElementName=btnCancel}" />
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </Button>
        <Grid x:Name="Popup" Margin="0,22,0,0" >
            <Border Grid.Row="1" Grid.ColumnSpan="2" Width="450" HorizontalAlignment="Left" CornerRadius="15" BorderThickness="1">
                <Grid Margin="10,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.35*"/>
                        <ColumnDefinition Width="0.3*"/>
                        <ColumnDefinition Width="0.35*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <TextBlock Margin="0" TextWrapping="Wrap" Text="Unit Name" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource PopupContent}"/>
                    <TextBlock Text="{Binding RCUnitName}" Grid.Column="1" Grid.ColumnSpan="2" Margin="0,2,24,0" Style="{StaticResource PopupContent}" TextWrapping="Wrap" HorizontalAlignment="Left" />

                    <TextBlock Margin="0" Grid.Row="1" TextWrapping="Wrap" Text="Original Capacity" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource PopupContent}"/>
                    <TextBlock Text="{Binding OriginalCapacity}" Grid.Row="1" Grid.Column="1" Margin="0,2,24,0" Style="{StaticResource PopupContent}" TextWrapping="Wrap" HorizontalAlignment="Left" />
                    <TextBlock Text="MBD/MMSCFD" Grid.Column="2" Grid.Row="1" Margin="0,2,24,0" Style="{StaticResource PopupContent}" TextWrapping="Wrap" HorizontalAlignment="Left" />

                    <TextBlock Margin="0" TextWrapping="Wrap"  Text="Reduced Capacity" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="2" Style="{StaticResource PopupContent}"/>
                    <TextBox Name="txtRC" Text="{Binding ReducedUnitCapacity, Mode=TwoWay, NotifyOnValidationError=True, UpdateSourceTrigger=Default}" MaxLength="100" Grid.Row="2" Grid.Column="1" Margin="0,10,24,0" Style="{StaticResource TextBoxStyle1}" TextWrapping="Wrap" Height="25">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="KeyDown">
                                <Presentation:InvokeDelegateCommandAction
                                Command="{Binding Source={StaticResource ServiceLocator},Path=ShutdownMngVM.RCTextBoxCommand}"
                                CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=InvokeParameter}" />
                            </i:EventTrigger>
                            <i:EventTrigger  EventName="Loaded">
                                <i:InvokeCommandAction  Command="{Binding RCTextBoxLoadCommand}" CommandParameter="{Binding ElementName=txtRC}" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </TextBox>
                    <TextBlock Text="MBD/MMSCFD" Grid.Row="2" Grid.Column="2" Margin="0,2,24,0" Style="{StaticResource PopupContent}" TextWrapping="Wrap" HorizontalAlignment="Left" />

                    <Grid Margin="0,0,0,0" Grid.Row="3" Grid.ColumnSpan="3" Height="35" HorizontalAlignment="Center" VerticalAlignment="Bottom">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Button x:Name="btnCreate" Margin="0" Command="{Binding Path=ReducedCapacityPopupCommand}" CommandParameter="{Binding ElementName=btnCreate}"  Width="95" Style="{StaticResource ButtonStyle}" VerticalAlignment="Bottom" Cursor="Hand">
                            <Grid Margin="9,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="0.827*"/>
                                </Grid.ColumnDefinitions>
                                <Image HorizontalAlignment="Right" Height="16" Margin="0,0,8,0" Source="/FIFP.DashBoard;component/Images/accept.png" Stretch="Fill" VerticalAlignment="Center" Width="19"/>
                                <TextBlock Grid.Column="1" HorizontalAlignment="Center" Margin="0" TextWrapping="Wrap" Text="Apply" VerticalAlignment="Center"/>
                            </Grid>
                        </Button>
                        <Button x:Name="btnCancel" Margin="10,0,0,0" Command="{Binding Path=CancelCommand}" CommandParameter="{Binding ElementName=btnCancel}" Style="{StaticResource ButtonStyle}" VerticalAlignment="Bottom" Grid.Column="1" Width="95" Cursor="Hand">
                            <Grid Margin="9,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="0.827*"/>
                                </Grid.ColumnDefinitions>
                                <TextBlock Grid.Column="1" HorizontalAlignment="Center" Margin="0" TextWrapping="Wrap" Text="Cancel" VerticalAlignment="Center"/>
                                <Image HorizontalAlignment="Right" Height="15" Margin="0,0,8,0" Source="/FIFP.DashBoard;component/Images/Dismiss.png" Stretch="Fill" VerticalAlignment="Center" Width="16"/>
                            </Grid>
                        </Button>
                    </Grid>

                </Grid>
            </Border>
        </Grid>
    </Grid>
</controls:ChildWindow>